﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using Cipher.Web.MVC;

namespace Cipher.Web.Areas.Design.Models {
    public class CipherModel {
        [Required(ErrorMessage = "Please enter a name for cipher.")]
        [Display(Name = "Cipher Name")]
        public string Name { get; set; }

        [Display(Name = "Description")]
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }

        [Required(ErrorMessage = "Please select a data source.")]
        [Display(Name = "Data Source")]
        public int SourceId { get; set; }
    }

    public class CipherDataSourceModel {
        [Required(ErrorMessage = "Please enter a name for cipher.")]
        [Display(Name = "Data Source Name")]
        public string SourceName { get; set; }

        [Display(Name = "Description")]
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }

        [Required(ErrorMessage = "Please enter database name.")]
        [Display(Name = "Database Name")]
        public string DatabaseName { get; set; }

        [Required(ErrorMessage = "Please enter server name.")]
        public string ServerName { get; set; }

        [Int(AllowEmpty = false, ErrorMessage = "Please enter a numer.")]
        public int ServerPort { get; set; }

        [EnumDataType(typeof(DatabaseType), ErrorMessage = "Please select a database type.")]
        public string DatabaseType { get; set; }
    }
}